"""
    爬取景区的天气预告
"""
import re

import requests

url = 'https://qq.weather.com.cn/mweather15d/10119010121A.shtml'
# 打开浏览器并打开网址
resp = requests.get(url)
# 设置一下编码格式
resp.encoding = 'utf-8'
# resp响应对象， 对象名.属性名  resp.text
# print(resp.text)

# <p class="h15listdayp2">10/07</p>
# <p>多云转阴</p>
# <div class="h15listtem h15k" style="">30/22℃</div>
# <td><div>东南风3-4级</div>
# <div>东风<3级</div></td>

date = re.findall('<p class="h15listdayp2">(.*)</p>', resp.text)
tq = re.findall('<p>([\u4e00-\u9fa5]*)</p>', resp.text)
wd = re.findall('<div class="h15listtem h15k" style="">(.*)</div>', resp.text)
feng1 = re.findall('<td>\n<div>(.*)</div>', resp.text)
feng2 = re.findall('<div>(.*)</div>\n</td>', resp.text)

# print(date)
# print(tq)
# print(wd)
# print(feng1)
# print(feng2)

lst = []
for a, b, c, d, e in zip(date, tq, wd, feng1, feng2):
    lst.append([a, b, c, d, e])

for item in lst:
    print(item)

